package com.sls.game.service.impl;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.google.gson.Gson;
import com.sls.core.common.CommonUtil;
import com.sls.core.socket.Head;
import com.sls.core.socket.ServerDisponseException;
import com.sls.game.pojo.SLSHttpInterfaceInfo;
import com.sls.game.service.TestService;

@Service("testService")
public class TestServiceImpl implements TestService {

	private static Logger log = Logger.getLogger(TestServiceImpl.class);
	private Gson gson = null;

	public TestServiceImpl() {
		gson = CommonUtil.gson();
	}

	@Override
	public String saveOrderStatusMsg(String body, Head head)
			throws ServerDisponseException {
		SLSHttpInterfaceInfo info = gson.fromJson(body,
				SLSHttpInterfaceInfo.class);
		
		log.info("下游用户的异步推送结果：" + "\n下游用户订单号：" + info.getPtOrderNo()
				+ "\n本地订单编号:" + info.getSupOrderNo() + 
				"\n订单处理结果：" + info.getStatus()+
				"\n充值成功时间:" + info.getSupOrderSuccessTime()+
				"\n失败原因：" + info.getFailedReason());
		
		return null;
	}

}
